package com.usian.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.usian.common.model.paper.PaperHistory;
import com.usian.mapper.PaperHistoryMapper;
import com.usian.service.PaperHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @projectName: 2210A-project1
 * @package: com.usian.service.impl
 * @className: PaperHistoryServiceImpl
 * @author: 莫洪维
 * @email: 1204315800@qq.com
 * @description: TODO
 * @date: 2023/9/4 16:01
 */
@Service
public class PaperHistoryServiceImpl extends ServiceImpl<PaperHistoryMapper, PaperHistory> implements PaperHistoryService {

    @Override
    public List<PaperHistory> toHistory(PaperHistory paperHistory) {
        //调用方法进行查询
        QueryWrapper<PaperHistory> wrapper = new QueryWrapper<>();
        wrapper.lambda()
                .eq(PaperHistory::getMemberId,paperHistory.getMemberId())
                .eq(PaperHistory::getPaperId,paperHistory.getPaperId())
                .eq(PaperHistory::getMemberTestHistoryId,paperHistory.getMemberTestHistoryId());
        List<PaperHistory> list = this.baseMapper.selectList(wrapper);
        return list;
    }
}
